import Vue from 'vue'
import vueRouter from 'vue-router'
import routes from './router.js'
Vue.use(vueRouter)


export  function createRouter() {
  let router = new vueRouter({
    routes,
    // mode: 'hash', // 路由地址后面有#号
    mode: 'history', // 去掉路由地址后的#号
    // base: '/' //应用的基路径

  });
  router.beforeEach((to,from,next)=>{
    next()
  })
  return router // 返回router实例
}